<!--
 * @Author: 熔岩巨兽 2141826215@qq.com
 * @Date: 2024-08-27 23:09:08
 * @LastEditTime: 2024-08-27 23:19:24
 * @LastEditors: 熔岩巨兽 2141826215@qq.com
 * @FilePath: \vue-vite-project\src\views\CommunicationMode\customEvent\event1.vue
 * Copyright (c) 2024 by 熔岩巨兽 2141826215@qq.com, All Rights Reserved. 
-->
<template>
  <div class="event_warpper">
    <h1>我是event1组件</h1>
    <button @click="eventClick">自定义事件</button>
  </div>
</template>

<script lang="ts" setup name="event1">
import { ref } from "vue";
let $emit = defineEmits(["event1"]);
const eventClick = () => {
  console.log("自定义事件");
  $emit("event1", "我是event1组件，自定义事件");
};
</script>

<style scoped>
.event_warpper {
  height: 250px;
  width: 100%;
  color: #000;
  background-color: rgb(142, 231, 201);
}
</style>
